webpackJsonp([5],{

/***/ 186:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Admin_vue__ = __webpack_require__(237);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Admin_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Admin_vue__);
/* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Admin_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Admin_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_node_modules_vue_loader_lib_template_compiler_index_id_data_v_321b1dcc_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Admin_vue__ = __webpack_require__(266);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_node_modules_vue_loader_lib_template_compiler_index_id_data_v_321b1dcc_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Admin_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_node_modules_vue_loader_lib_template_compiler_index_id_data_v_321b1dcc_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Admin_vue__);
var disposed = false
function injectStyle (ssrContext) {
  if (disposed) return
  __webpack_require__(264)
}
var normalizeComponent = __webpack_require__(1)
/* script */


/* template */

/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-321b1dcc"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Admin_vue___default.a,
  __WEBPACK_IMPORTED_MODULE_1__babel_loader_node_modules_vue_loader_lib_template_compiler_index_id_data_v_321b1dcc_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Admin_vue___default.a,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)
Component.options.__file = "src/views/rbac/Admin.vue"

/* hot reload */
if (false) {(function () {
  var hotAPI = require("vue-hot-reload-api")
  hotAPI.install(require("vue"), false)
  if (!hotAPI.compatible) return
  module.hot.accept()
  if (!module.hot.data) {
    hotAPI.createRecord("data-v-321b1dcc", Component.options)
  } else {
    hotAPI.reload("data-v-321b1dcc", Component.options)
  }
  module.hot.dispose(function (data) {
    disposed = true
  })
})()}

/* harmony default export */ __webpack_exports__["default"] = (Component.exports);


/***/ }),

/***/ 188:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});
/*
 * @Author: wuchenge
 * @Date:   2020-07-06 14:16:57
 * @Last Modified by:   wuchenge
 * @Last Modified time: 2020-12-07 21:46:45
 */

exports.default = {
    data: function data() {
        return {
            // 当前url
            preUrl: "",
            // 返回的要存储存的数组
            template_list: [],
            // 搜索条件
            filterSearch: {},
            // 分页
            page: {
                current: 1,
                size: 10,
                total: 0
            },
            // 多选
            multipleSelection: [],
            // 加载...
            listLoading: false,
            // 弹框
            ifModify: false,
            // 表单
            form: {}
        };
    },

    filters: {
        numToString: function numToString(value) {
            return value.toString();
        }
    },
    created: function created() {
        this.getList();
    },

    methods: {
        showLoading: function showLoading() {
            this.listLoading = true;
        },
        hideLoading: function hideLoading() {
            this.listLoading = false;
        },

        // 处理列表结果
        getListResult: function getListResult(data) {
            this.template_list = data.list;
        },

        // 获取请求列表分页url
        getListUrl: function getListUrl() {
            return '' + this.preUrl;
        },

        // 获取列表
        getList: function getList() {
            var _this = this;

            if (this.preUrl == '') return;
            this.showLoading();
            var url = this.getListUrl();

            var tmp = {
                'page': this.page.current,
                'size': this.page.size
            };
            var objs = Object.assign(tmp, this.filterSearch);
            this.$ajax.post(url, objs).then(function (res) {
                var data = res.data;
                _this.page.total = data.total;
                _this.getListResult(data);
                _this.hideLoading();
            }).catch(function (err) {
                _this.hideLoading();
            });
        },

        // 批量删除url
        addOrEditUrl: function addOrEditUrl() {
            return this.preUrl + '/modify';
        },

        // 添加/编辑
        addOrEdit: function addOrEdit(data) {
            var _this2 = this;

            var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

            // 添加验证
            if (typeof callback === 'function') {
                var flag = callback();
                if (!flag) {
                    return false;
                }
            }
            this.showLoading();
            var msg = data.id ? '修改' : '增加';
            var url = this.addOrEditUrl();
            this.$ajax.post(url, data).then(function (res) {
                if (!res.error_code) {
                    _this2.$Message.success(msg + res.message);
                    _this2.getList();
                    if (_this2.getOptions) _this2.getOptions();
                } else {
                    _this2.$Message.error(res.message);
                }

                _this2.hideLoading();
            }).catch(function (err) {
                _this2.hideLoading();
            });
        },

        // 批量删除url
        showOrHideUrl: function showOrHideUrl() {
            return this.preUrl + '/status';
        },
        showOrHide: function showOrHide(id, status) {
            var _this3 = this;

            this.$Modal.confirm({
                title: '是否改变状态',
                onOk: function onOk() {
                    var data = {
                        id: id,
                        status: status
                    };
                    var url = _this3.showOrHideUrl();

                    _this3.$ajax.post(url, data).then(function (res) {
                        var data = res.data;
                        if (!data.error_code) {
                            _this3.$Message.success(data.message);
                            _this3.getList();
                            if (_this3.getOptions) _this3.getOptions();
                        } else {
                            _this3.$Message.error(data.message);
                        }
                    }).catch(function (err) {
                        console.log(err);
                    });
                },
                onCancel: function onCancel() {
                    // this.$Message.info('Clicked cancel')
                }
            });
        },

        // 批量删除url
        deleteUrl: function deleteUrl() {
            return this.preUrl + '/delete';
        },

        // 批量删除
        deleteAll: function deleteAll() {
            if (this.multipleSelection.length === 0) {
                return this.$Message.error('请先选中需要删除的信息');
            }

            this.deleteItem(this.multipleSelection.toString());
        },

        // 多选
        selected: function selected(solution) {
            var _this4 = this;

            this.multipleSelection = [];
            solution.forEach(function (item) {
                _this4.multipleSelection.push(item.id);
            });
        },

        // 删除单个
        deleteItem: function deleteItem(id) {
            var _this5 = this;

            this.$Modal.confirm({
                title: '是否要删除选中',
                onOk: function onOk() {
                    var url = _this5.deleteUrl();
                    _this5.$ajax.post(url, { id: id }).then(function (res) {
                        if (!res.error_code) {
                            _this5.$Message.success(res.message);
                            _this5.getList();
                            if (_this5.getOptions) _this5.getOptions();
                        } else {
                            _this5.$Message.error(res.message);
                        }

                        _this5.hideLoading();
                    }).catch(function (err) {
                        _this5.hideLoading();
                    });
                },
                onCancel: function onCancel() {
                    // this.$Message.info('Clicked cancel')
                }
            });
        },

        // 分页
        changePage: function changePage(index) {
            this.page.current = index;
            this.getList();
        }
    }
};

/***/ }),

/***/ 237:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _common = __webpack_require__(188);

var _common2 = _interopRequireDefault(_common);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = {
    mixins: [_common2.default],
    data: function data() {
        return {
            preUrl: 'rbac/admin',
            roles: [],
            columns: [{
                type: 'selection',
                width: 60
            }, {
                title: "帐号",
                key: "account"
            }, {
                title: "昵称",
                key: "nick_name"
            }, {
                title: "角色",
                key: "role",
                slot: "role"
            }, {
                title: "状态",
                key: "status",
                slot: "status"
            }, {
                title: "操作",
                key: "action",
                slot: "action"
            }],
            filterSearch: {
                account: '',
                nick_name: ''
            },
            ruleFrom: {
                account: [{ required: true, message: '账号不能为空！', trigger: 'blur' }],
                nick_name: [{ required: true, message: '昵称不能为空！', trigger: 'blur' }],
                roles: [{ required: true, message: '角色不能为空！', trigger: 'blur' }]
            },
            form: {
                id: 0,
                account: '',
                nick_name: '',
                roles: [],
                status: 1,
                password_confirmation: '',
                password: ''
            }

        };
    },


    computed: {

        // 检查两次密码是否一致
        pwd_check: function pwd_check() {
            return this.form.password === this.form.password_confirmation;
        }
    },

    mounted: function mounted() {
        // 获取参数
        this.getOptions();
    },


    methods: {
        getOptions: function getOptions() {
            var _this = this;

            var url = 'rbac/admin/options';
            this.$ajax.post(url).then(function (res) {
                if (!res.error_code) {
                    _this.roles = res.data.list;
                }
            }).catch(function (err) {
                return console.log(err);
            });
        },
        addBtn: function addBtn() {
            this.form = {
                id: 0,
                account: '',
                nick_name: '',
                roles: [],
                status: 1,
                password_confirmation: '',
                password: ''
            };
            this.ifModify = true;
        },
        modifyBtn: function modifyBtn(row) {
            var roles = [];
            row.roles.forEach(function (role) {
                return roles.push(role.id);
            });

            this.form = {
                account: row.account,
                nick_name: row.nick_name,
                roles: roles,
                status: row.status,
                password_confirmation: '',
                password: '',
                id: row.id
            };
            this.ifModify = true;
        },
        rules: function rules() {
            // 检测标识
            if (this.form.account.trim() == '') {
                this.$Message.warning('请填写账号');
                return false;
            }

            // 检测标题
            if (this.form.nick_name.trim() == '') {
                this.$Message.warning('请填写昵称');
                return false;
            }

            // 新增必须填写密码
            if (this.form.id === 0 && this.form.password.trim() == '') {
                this.$Message.warning('请填写必须');
                return false;
            }

            // 检测标题
            if (this.form.roles.length == 0) {
                this.$Message.warning('请选择角色');
                return false;
            }

            return true;
        }
    }

}; //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

/***/ }),

/***/ 264:
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__(265);
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var update = __webpack_require__(8)("fa9c02fc", content, false, {});
// Hot Module Replacement
if(false) {
 // When the styles change, update the <style> tags
 if(!content.locals) {
   module.hot.accept("!!../../../node_modules/css-loader/index.js!../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-321b1dcc\",\"scoped\":true,\"hasInlineConfig\":false}!../../../node_modules/less-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Admin.vue", function() {
     var newContent = require("!!../../../node_modules/css-loader/index.js!../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-321b1dcc\",\"scoped\":true,\"hasInlineConfig\":false}!../../../node_modules/less-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Admin.vue");
     if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
     update(newContent);
   });
 }
 // When the module is disposed, remove the <style> tags
 module.hot.dispose(function() { update(); });
}

/***/ }),

/***/ 265:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(7)(false);
// imports


// module
exports.push([module.i, "", ""]);

// exports


/***/ }),

/***/ 266:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var render = function render() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", [_c("Card", [_c("p", { attrs: { slot: "title" }, slot: "title" }, [_vm._v("\n            管理员列表\n        ")]), _vm._v(" "), _c("span", { attrs: { slot: "extra" }, slot: "extra" }, [_c("Button", { attrs: { type: "error" }, on: { click: _vm.deleteAll } }, [_vm._v("删除")]), _vm._v(" "), _c("Button", { attrs: { type: "primary" }, on: { click: _vm.addBtn } }, [_vm._v("添加")])], 1), _vm._v(" "), _c("Row", { staticClass: "functionWrapper" }, [_c("div", { staticClass: "searchWrapper clearfix" }, [_c("div", { staticClass: "poptip" }, [_c("Poptip", {
    attrs: {
      trigger: "hover",
      content: "帐号",
      placement: "bottom-start"
    }
  }, [_c("Input", {
    attrs: { placeholder: "帐号搜索", clearable: "" },
    model: {
      value: _vm.filterSearch.account,
      callback: function callback($$v) {
        _vm.$set(_vm.filterSearch, "account", $$v);
      },
      expression: "filterSearch.account"
    }
  })], 1)], 1), _vm._v(" "), _c("div", { staticClass: "poptip" }, [_c("Poptip", {
    attrs: {
      trigger: "hover",
      content: "昵称",
      placement: "bottom-start"
    }
  }, [_c("Input", {
    attrs: { placeholder: "昵称搜索", clearable: "" },
    model: {
      value: _vm.filterSearch.nick_name,
      callback: function callback($$v) {
        _vm.$set(_vm.filterSearch, "nick_name", $$v);
      },
      expression: "filterSearch.nick_name"
    }
  })], 1)], 1), _vm._v(" "), _c("div", { staticClass: "btns" }, [_c("Button", {
    attrs: { type: "info", size: "small" },
    on: { click: _vm.getList }
  }, [_vm._v("搜索")])], 1)])]), _vm._v(" "), _c("Row", [_c("Table", {
    attrs: {
      columns: _vm.columns,
      data: _vm.template_list,
      loading: _vm.listLoading,
      border: ""
    },
    on: { "on-selection-change": _vm.selected },
    scopedSlots: _vm._u([{
      key: "role",
      fn: function fn(ref) {
        var row = ref.row;
        var index = ref.index;
        return [row.is_supper ? _c("span", { staticClass: "badge badge-success" }, [_vm._v("\n                        超级管理员\n                    ")]) : _vm._l(row.roles, function (role, index) {
          return _c("span", {
            key: index,
            staticClass: "badge badge-secondary mr-2"
          }, [_vm._v("\n                        " + _vm._s(role.name) + "\n                    ")]);
        })];
      }
    }, {
      key: "status",
      fn: function fn(ref) {
        var row = ref.row;
        var index = ref.index;
        return [row.status == 1 ? _c("span", { staticClass: "badge badge-success" }, [_vm._v("正常")]) : _c("span", { staticClass: "badge badge-warning" }, [_vm._v("禁用")])];
      }
    }, {
      key: "action",
      fn: function fn(ref) {
        var row = ref.row;
        var index = ref.index;
        return [!row.is_supper ? _c("Button", {
          staticStyle: { "margin-right": "5px" },
          attrs: { type: "primary", size: "small" },
          on: {
            click: function click($event) {
              return _vm.modifyBtn(row);
            }
          }
        }, [_vm._v("编辑")]) : _vm._e()];
      }
    }])
  })], 1), _vm._v(" "), _c("Row", { staticClass: "pageWrapper" }, [_c("Page", {
    staticClass: "buttomPage",
    attrs: {
      total: _vm.page.total,
      "page-size": _vm.page.size,
      current: _vm.page.current,
      "show-elevator": ""
    },
    on: { "on-change": _vm.changePage }
  })], 1)], 1), _vm._v(" "), _c("Modal", {
    attrs: { title: "编辑/添加" },
    on: {
      "on-ok": function onOk($event) {
        return _vm.addOrEdit(_vm.form, _vm.rules);
      }
    },
    model: {
      value: _vm.ifModify,
      callback: function callback($$v) {
        _vm.ifModify = $$v;
      },
      expression: "ifModify"
    }
  }, [_c("Form", {
    attrs: { model: _vm.form, rules: _vm.ruleFrom, "label-width": 80 }
  }, [_c("FormItem", { attrs: { label: "账号:" } }, [_c("Input", {
    attrs: { placeholder: "账号..." },
    model: {
      value: _vm.form.account,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "account", $$v);
      },
      expression: "form.account"
    }
  })], 1), _vm._v(" "), _c("FormItem", { attrs: { label: "昵称:" } }, [_c("Input", {
    attrs: { placeholder: "昵称..." },
    model: {
      value: _vm.form.nick_name,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "nick_name", $$v);
      },
      expression: "form.nick_name"
    }
  })], 1), _vm._v(" "), _c("FormItem", {
    staticClass: "resetRequired",
    class: { resetFromErr: !_vm.pwd_check },
    attrs: { label: "密码:", prop: "password" }
  }, [_c("Tag", { attrs: { color: "blue" } }, [_vm._v("修改时，填写则表示修改密码，不填则原来密码")]), _vm._v(" "), _c("Input", {
    attrs: { type: "password" },
    model: {
      value: _vm.form.password,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "password", $$v);
      },
      expression: "form.password"
    }
  }), _vm._v(" "), !_vm.pwd_check ? _c("div", { staticClass: "ivu-form-item-error-tip" }, [_vm._v("两次密码输入不一致！")]) : _vm._e()], 1), _vm._v(" "), _vm.form.password != "" ? _c("FormItem", {
    staticClass: "resetRequired",
    class: { resetFromErr: !_vm.pwd_check },
    attrs: { label: "确认密码:", prop: "passwdCheck" }
  }, [_c("Input", {
    attrs: { type: "password" },
    model: {
      value: _vm.form.password_confirmation,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "password_confirmation", $$v);
      },
      expression: "form.password_confirmation"
    }
  }), _vm._v(" "), !_vm.pwd_check ? _c("div", { staticClass: "ivu-form-item-error-tip" }, [_vm._v("两次密码输入不一致！")]) : _vm._e()], 1) : _vm._e(), _vm._v(" "), _c("FormItem", { attrs: { label: "状态:" } }, [_c("RadioGroup", {
    model: {
      value: _vm.form.status,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "status", $$v);
      },
      expression: "form.status"
    }
  }, [_c("Radio", { attrs: { label: 1 } }, [_c("Icon", { attrs: { type: "1" } }), _vm._v(" "), _c("span", [_vm._v("启用")])], 1), _vm._v(" "), _c("Radio", { attrs: { label: 2 } }, [_c("Icon", { attrs: { type: "2" } }), _vm._v(" "), _c("span", [_vm._v("禁用")])], 1)], 1)], 1), _vm._v(" "), _c("FormItem", { attrs: { label: "角色" } }, [_c("Select", {
    attrs: { multiple: "" },
    model: {
      value: _vm.form.roles,
      callback: function callback($$v) {
        _vm.$set(_vm.form, "roles", $$v);
      },
      expression: "form.roles"
    }
  }, _vm._l(_vm.roles, function (role, index) {
    return _c("Option", { key: index, attrs: { value: role.id } }, [_vm._v(_vm._s(role.name))]);
  }), 1)], 1)], 1)], 1)], 1);
};
var staticRenderFns = [];
render._withStripped = true;
var esExports = { render: render, staticRenderFns: staticRenderFns };
exports.default = esExports;

if (false) {
  module.hot.accept();
  if (module.hot.data) {
    require("vue-hot-reload-api").rerender("data-v-321b1dcc", esExports);
  }
}

/***/ })

});